<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>es6 Module</title>
    <!--<script type="module">-->
        <!--import {func} from './modules/a.js';-->
        <!--console.log(func());-->
    <!--</script>-->
    <script>
        window.errHandler = function(e) {
            console.error('ERROR is here', e)
        };
        window.loadHandler = function(e) {
            console.info('loaded', e);
        };
    </script>
</head>
<body>
    <div>
        <h1 id="h"></h1>
    </div>
    <script type="module">
        import {func} from './modules/a.js'; //即使在代码中引用其它js，也必须有后缀
        document.getElementById('h').innerText = func();
    </script>
</body>
</html>